package com.huiyou.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ThreadPoolExecutor;


public class IntegerUtil {

    public static void main(String[] args){
//        int a=1;
//        Map map=new HashMap();
//        map.put("a",1);
//        logger.info(objToInt(map.get("a"))+"");
//        map.put("a","1");
//        logger.info(objToInt(map.get("a"))+"");
//        map.put("a",new ThreadPoolExecutor.AbortPolicy());
//        logger.info(objToInt(map.get("a"))+"");
        Integer integer1=100;
        Integer integer2=100;
        Integer integer3=150;
        Integer integer4=150;
        int i1=integer1;
        int i2=integer2;
        int i3=integer3;
        int i4=integer4;
        int cardid=0;
        logger.info(String.valueOf(integer1==integer2));
        logger.info(String.valueOf(integer3==integer4));
        if (integer1==integer2){
            logger.info("i1=i2");
        }
        if (integer3==integer4){
            logger.info("i3=i4");
        }
        HashMap map=new HashMap()
;
        map.put("cardid",cardid);
        logger.info(i1+i2+i3+i4+"");
        logger.info(String.valueOf(map));
    }

	private static Logger logger = LoggerFactory.getLogger(IntegerUtil.class);

    static public int objToInt(Object object) throws NumberFormatException {
        if(object==null){
            throw new NumberFormatException();
        }
        if (object instanceof Integer) {
            logger.info("Integer");
            return (Integer)object;
        }
        logger.info("Obj");
        return  Integer.parseInt(object.toString());




    }




}
